#pragma once
#include "Vec3.h"

class  CRay
{
public:
	CRay() = default;
	CRay(const Vec3& vOrigin, const Vec3& vDirection, double vTime) :m_Origin(vOrigin), m_Direction(vDirection), m_Time(vTime) {};
	CRay(const Vec3& vOrigin, const Vec3& vDirection) :CRay(vOrigin, vDirection, 0) {};

	const Point3& origin() const { return m_Origin; }
	const Vec3& direction() const { return m_Direction; }
	const double time()const { return m_Time; }

	Point3 at(double t) const {
		return m_Origin + t * m_Direction;
	}
	~CRay() {};

private:
	Vec3 m_Origin;
	Vec3 m_Direction;
	double m_Time;
};